package xkp.lesson1;

import java.io.IOException;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Arrays;

public class Server {
    public static void main(String[] args) throws IOException {
       ServerSocket serverSocket = new ServerSocket(8888);
       Socket socket = serverSocket.accept();
       //1M
       byte[] buf = new byte[1024*1024];
       Arrays.fill(buf, (byte) 1);
       OutputStream outputStream = socket.getOutputStream();
       outputStream.write(buf);
       outputStream.flush();
       outputStream.close();
       socket.close();
       serverSocket.close();
    }
}
